<template>
  <div class="app-container">
    <div class="filter-container">
      <el-form :inline="true" :model="formModel">
        <el-form-item class="no-warn-item" label="表名(大写):" prop="tableName">
          <el-input
            v-model="formModel.tableName"
            class="filter-item "
            clearable
          />
        </el-form-item>
        <el-form-item class="no-warn-item" label="前缀:" prop="tablePrefixes">
          <el-input
            v-model="formModel.tablePrefixes"
            class="filter-item "
            clearable
          />
        </el-form-item>
        <el-row class="submit-area">
          <el-col :span="12">
            <el-button type="primary" plain @click="createCode">生成代码</el-button>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CodeGeneratorList',
  components: {

  },
  props: {},
  data() {
    return {
      imageSrc: '',
      formModel: {
        tableName: '',
        tablePrefixes: ''
      }
    }
  },
  computed: {},
  mounted() {

  },
  methods: {
    createCode() {
      if (!this.formModel.tableName) {
        this.$message.warning('请输入数据库表名!')
        return false
      }
      const url = '/codeGenerator/codeGenerator'
      this.post(url, this.formModel).then(res => {
        this.$info('生成代码成功!')
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
